Method: rich.pretty.install.<locals>.display_hook
Calls: 1, Exceptions: 0, Paths: 1Back
Path 1: 1 calls (1.0)
dict (1)
1def display_hook(value: Any) -> None:
2 """Replacement sys.displayhook which prettifies objects with Rich."""
3 if value is not None:
4 assert console is not None
5 builtins._ = None # type: ignore[attr-defined]
6 console.print(
7 value
8 if _safe_isinstance(value, RichRenderable)
9 else Pretty(
10 value,
11 overflow=overflow,
12 indent_guides=indent_guides,
13 max_length=max_length,
14 max_string=max_string,
15 max_depth=max_depth,
16 expand_all=expand_all,
17 ),
18 crop=crop,
19 )
20 builtins._ = value # type: ignore[attr-defined]